package com.baiwei.vpnapi.config.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionManager;

import javax.sql.DataSource;

/**
 * @program: vpnapi
 * @description: 事务配置
 * @author: Mr. Stone
 * @create: 2020-02-24 19:20
 **/
@Configuration
@EnableAutoConfiguration
public class TransctionManagementConfiguration {
    @Autowired
    private DataSource dataSource;
    public TransactionManager transactionManager(){
        return new DataSourceTransactionManager(dataSource);
    }
}
